home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / GRAPHICS / COMMON.ZIP / TEXTD.C < prev    next >
Encoding:
Text File  |  1995-12-08  |  920 b   |  45 lines

  1. /* attr:text */
  2. /* ----------------------- dput() ------------------------- March 11,1991 */
  3. void dput(UCHAR attr, int x, int y, char *s)
  4. {
  5.    int off;
  6.    char far *txt;
  7.  
  8.    if ( *s )
  9.       {
  10.       off=160*y + (x<<1);
  11.       txt=MK_FP(text_segment, off);
  12.  
  13.       while ( *s )
  14.          {
  15.          *txt++=*s++;
  16.          *txt++=attr;
  17.          }
  18.  
  19. #if 0
  20.       asm      {
  21.                   push ds
  22.                   push di
  23.  
  24.                   mov ah, attr
  25.                   mov es, text_segment
  26.                   mov si, off
  27.                   mov cx, len
  28.                   lds di, s
  29.                   }
  30.          start:
  31.       asm      {
  32.                   mov al, ds:[di]
  33.                   mov es:si, ax
  34.                   inc di
  35.                   inc si
  36.                   inc si
  37.  
  38.                   loop start
  39.  
  40.                   pop di
  41.                   pop ds
  42.          }
  43. #endif
  44.       }
  45.